package com.neusoft.neuiotms.dcom.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Length;

import com.neusoft.bizcore.web.jpa.model.AbstractModel;
import com.neusoft.bizcore.web.jpa.model.Comment;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

@Getter
@Setter
@ToString
@Entity
@org.hibernate.annotations.Table(appliesTo = "neuiot_scheduling_item", comment = "排班规则详细表")
@Table(name = "neuiot_scheduling_item")
public class SchedulingRuleItem extends AbstractModel {

    private static final long serialVersionUID = 1L;

    /** 周期数 */
    @NotNull(message = "周期数不能为空")
    @Comment("int(11) NULL COMMENT '小组数'")
    private int cyclicalNumber;

    /** 班次名称 */
    @NotBlank(message = "班次名称不能为空")
    @Length(max = 255, message = "班次名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '班次名称'")
    private String classesItemName;

    /** 班次编码 */
    @NotBlank(message = "班次编码不能为空")
    @Length(max = 255, message = "班次编码不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '班次名称'")
    private String classesItemCode;

    /** 开始时间 */
    @Column(length = 6, nullable = false)
    @Comment("varchar(6) NOT NULL COMMENT '开始时间'")
    private String startTime;

    /** 结束时间 */
    @Column(length = 6, nullable = false)
    @Comment("varchar(6) NOT NULL COMMENT '结束时间'")
    private String endTime;

    /** 小组顺序 */
    @NotNull(message = "小组顺序不能为空")
    @Comment("int(11) NULL COMMENT '小组顺序'")
    private int groupNumber;

    /** 小组名称 */
    @NotBlank(message = "小组名称不能为空")
    @Length(max = 255, message = "小组名称不能超过{max}位")
    @Column(length = 255, nullable = false)
    @Comment("varchar(255) NOT NULL COMMENT '小组名称'")
    private String groupName;

    /** 关联规则 */
    @ManyToOne
    private SchedulingRule rule;
}
